package top.mcwebsite.playandroid.business.login.impl.ui

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Lock
import androidx.compose.material.icons.filled.Person
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.unit.dp


@Composable
fun UserName() {
    TextField(
        value = "", onValueChange = {},
        singleLine = true,
        colors = TextFieldDefaults.colors(
            focusedIndicatorColor = Color.Transparent,
            unfocusedIndicatorColor = Color.Transparent,
        ),
        placeholder = {
            Text("请输入用户名")
        },
        leadingIcon = {
            Icon(Icons.Default.Person, contentDescription = null, modifier = Modifier.size(20.dp))
        },
        modifier = Modifier.fillMaxWidth(),
    )
}

@Composable
fun Password(
    hintText: String = "请输入密码"
) {
    TextField(
        value = "", onValueChange = {},
        singleLine = true,
        colors = TextFieldDefaults.colors(
            focusedIndicatorColor = Color.Transparent,
            unfocusedIndicatorColor = Color.Transparent,
        ),
        placeholder = {
            Text(hintText)
        },
        leadingIcon = {
            Icon(Icons.Default.Lock, contentDescription = null, modifier = Modifier.size(20.dp))
        },
        visualTransformation = PasswordVisualTransformation(),
        modifier = Modifier.fillMaxWidth(),
    )
}